[Template:scriptincludes.html]
<script>
			
	$(function() {	
		$("#tabs").tabs();			
	}); 

$(document).ready(function(){



//websites
var myParams = {cmd: "getdata",templ: "clientwebopen.xsl",ctltype: "WEBSITE",filter: " and ([xmlData].value('(genxml/hidden/clientid)[[1]]', 'nvarchar(10)') = '[<tag type="valueof" xpath="genxml/hidden/itemid" />]')"};
var cmdget = '/desktopmodules/Nbright/NBrightEspace/XmlConnector.ashx?' + jQuery.param(myParams);
$.fn.initlist('.websitedetails', '', cmdget);

//Urls
myParams = {cmd: "getdata",templ: "clienturlopen.xsl",ctltype: "URL",filter: " and ([xmlData].value('(genxml/hidden/clientid)[[1]]', 'nvarchar(10)') = '[<tag type="valueof" xpath="genxml/hidden/itemid" />]')"};
cmdget = '/desktopmodules/Nbright/NBrightEspace/XmlConnector.ashx?' + jQuery.param(myParams);
$.fn.initlist('.urldetails', '', cmdget);

//Invoices
myParams = {cmd: "getdata",templ: "clientinvopen.xsl",ctltype: "INVOICES",filter: " and ([xmlData].value('(genxml/hidden/clientid)[[1]]', 'nvarchar(10)') = '[<tag type="valueof" xpath="genxml/hidden/itemid" />]') and ([xmlData].value('(genxml/checkbox/chkarchived)[[1]]', 'nvarchar(10)') = 'False')"};
cmdget = '/desktopmodules/Nbright/NBrightEspace/XmlConnector.ashx?' + jQuery.param(myParams);
$.fn.initlist('.invdetails', '', cmdget);

//Estimates
myParams = {cmd: "getdata",templ: "clientestopen.xsl",ctltype: "ESTIMATES",filter: " and ([xmlData].value('(genxml/hidden/clientid)[[1]]', 'nvarchar(10)') = '[<tag type="valueof" xpath="genxml/hidden/itemid" />]') and ([xmlData].value('(genxml/checkbox/chkarchived)[[1]]', 'nvarchar(10)') = 'False')"};
cmdget = '/desktopmodules/Nbright/NBrightEspace/XmlConnector.ashx?' + jQuery.param(myParams);
$.fn.initlist('.estdetails', '', cmdget);

//Outstanding Payments
myParams = {cmd: "getdata",templ: "clientout.xsl",ctltype: "INSTALLMENT%",filter: " and ([xmlData].value('(genxml/hidden/clientid)[[1]]', 'nvarchar(10)') = '[<tag type="valueof" xpath="genxml/hidden/itemid" />]') and ([xmlData].value('(genxml/hidden/dbltotaldue)[[1]]', 'nvarchar(10)') != '0') "};
cmdget = '/desktopmodules/Nbright/NBrightEspace/XmlConnector.ashx?' + jQuery.param(myParams);
$.fn.initlist('.outdetails', '', cmdget);

//Email Redirect
myParams = {cmd: "getdata",templ: "clientemailopen.xsl",ctltype: "URLEMAIL%",filter: " and ([xmlData].value('(genxml/hidden/clientidonemail)[[1]]', 'nvarchar(10)') = '[<tag type="valueof" xpath="genxml/hidden/itemid" />]')"};
cmdget = '/desktopmodules/Nbright/NBrightEspace/XmlConnector.ashx?' + jQuery.param(myParams);
$.fn.initlist('.emaildetails', '', cmdget);

//Get Outstanding Balance
cmdget = '/desktopmodules/Nbright/NBrightEspace/XmlConnector.ashx?cmd=getoutbal&itemid=[<tag type="valueof" xpath="genxml/hidden/itemid" />]';
$.get(cmdget, function (data) {
	var strButton = '';
	if (data != '0.00')
	{
		strButton += '<div class="nwb-button-container"><a target="_blank" href="http://payment.nevoweb.com/?txtAmountPayed=';
		strButton += data + '&txtPayeeName=[<tag type="valueof" xpath="genxml/textbox/txtclientname" />]&txtPayeeEmailAddress=[<tag type="valueof" xpath="genxml/textbox/txtpersonalemail" />]&txtComments=[<tag type="valueof" xpath="genxml/textbox/txtclientref" />]"';
		strButton += 'class="NBright_AcceptButton">Pay Outstanding Amount</a></div><br/>';
		strButton += '<b>NOTE: Any payments made will only be reflected in the system after confirmation from the bank, usually within 2 working days.</b><br/><br/>';
	}
	$('.outbalance').html('<h1>Total Outstanding : ' + data + '</h1>' + strButton);
});
	
});

</script>	
<div>
[<tag id="UserID" type="hidden" value="" />]
[<tag id="ClientID" type="hidden" value="" />]
[<tag id="ItemID" type="hidden" value="databind:ItemID" />]
[<tag id="dteModifiedDate" type="hidden" value="" />]
[<tag id="LockedBy" type="hidden" value="" />]
[<tag id="htmlDisplayLockedBy" type="hidden" value="" />]
[<tag type="valueof" xpath="genxml/hidden/htmldisplaylockedby" />]
<table class="normal" border="0px" cellpadding="1px" cellspacing = "1px">
<tr>
<td align="right" width="150px">Client Ref : </td>
<td  width="200px">
[<tag type="valueof" xpath="genxml/textbox/txtclientref" />]
</td>
<td align="right"  width="150px">Address : </td>
<td>
[<tag type="valueof" xpath="genxml/textbox/txtclientadd1" />]

</td>
</tr>
<tr>
<td align="right">UserName : </td>
<td>[<tag type="valueof" xpath="genxml/textbox/txtusername" />]
</td>
<td align="right"></td>
<td>[<tag type="valueof" xpath="genxml/textbox/txtclientadd2" />]
</td>
</tr>
<tr>
<td align="right">Client Name : </td>
<td>[<tag type="valueof" xpath="genxml/textbox/txtclientname" />]
</td>
<td align="right">Post Code : </td>
<td>[<tag type="valueof" xpath="genxml/textbox/txtclientpc" />]
</td>
</tr>
<tr>
<td align="right">Company Name : </td>
<td>[<tag type="valueof" xpath="genxml/textbox/txtcompanyname" />]
</td>
<td align="right">Town : </td>
<td>[<tag type="valueof" xpath="genxml/textbox/txtclientadd3" />]
</td>
</tr>
<tr>
<td align="right">SIRET No.</td>
<td>[<tag type="valueof" xpath="genxml/textbox/txtsiret" />]
</td>
<td align="right">Tel1 : </td>
<td>[<tag type="valueof" xpath="genxml/textbox/txttel1" />]
</td>
</tr>
<tr>
<td style="text-align: right">TVA No.</td>
<td>[<tag type="valueof" xpath="genxml/textbox/txttva" />]
</td>
<td align="right">Tel2 : </td>
<td>[<tag type="valueof" xpath="genxml/textbox/txttel2" />]
</td>
</tr>
<tr>
<td align="right"></td>
<td></td>
<td align="right">Email : </td>
<td>[<tag type="valueof" xpath="genxml/textbox/txtpersonalemail" />]
</td>
</tr>
<tr>
<td></td>
<td></td>
<td align="right"></td>
<td></td>
</tr>
<tr>
<td>Other Contact</td>
<td>[<tag type="valueof" xpath="genxml/textbox/txtcontactname1" />]
</td>
<td colspan="2">Tel : [<tag type="valueof" xpath="genxml/textbox/txtcontacttel1" />]<br/>
  Email : [<tag type="valueof" xpath="genxml/textbox/txtcontactemail1" />]
</td>
</tr>
<tr>
<td>Other Contact</td>
<td>[<tag type="valueof" xpath="genxml/textbox/txtcontactname2" />]
</td>
<td colspan="2">Tel : [<tag type="valueof" xpath="genxml/textbox/txtcontacttel2" />]<br/>
  Email : [<tag type="valueof" xpath="genxml/textbox/txtcontactemail2" />]
</td>
</tr>
</table>
		<div id="tabs">
			<ul>
				<li><a href="#tabs-1">Outstanding</a></li>
				<li><a href="#tabs-2">Estimates</a></li>
				<li><a href="#tabs-3">Invoices</a></li>
				<li><a href="#tabs-4">Websites</a></li>
				<li><a href="#tabs-5">Urls</a></li>
				<li><a href="#tabs-6">Email Redirects</a></li>
			</ul>
			<div id="tabs-1">		
				<div class="outbalance">
				</div>
				<div class="outdetails">
				</div>
			</div>
			<div id="tabs-2">
				<div class="estdetails">
				</div>
			</div>
			<div id="tabs-3">
				<div class="invdetails">
				</div>
			</div>
			<div id="tabs-4">
				<div class="websitedetails">
				</div>
			</div>
			<div id="tabs-5">
				<div class="urldetails">
				</div>
			</div>
			<div id="tabs-6">
				<div class="emaildetails">
				</div>
			</div>
		</div>
</div>

